package com.atguigu.admin.service;

import com.atguigu.admin.model.entity.SysRole;
import com.atguigu.admin.model.vo.AssginRoleVo;
import com.atguigu.admin.model.vo.SysRoleQueryVo;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 角色 服务类
 * </p>
 *
 * @author atguigu
 * @since 2022-10-25
 */
public interface SysRoleService extends IService<SysRole> {
    /**
     * 分页查询
     *
     * @param pageParam
     * @param roleQueryVo
     * @return
     */
    IPage<SysRole> selectPage(Page<SysRole> pageParam, SysRoleQueryVo roleQueryVo);

    /**
     * 根据用户获取角色数据
     *
     * @param userId
     * @return
     */
    Map<String, Object> getRolesByUserId(Long userId);

    /**
     * 分配角色
     *
     * @param assginRoleVo
     */
    void doAssign(AssginRoleVo assginRoleVo);

    /**
     * 根据用户id获取角色名称集合
     *
     * @param userId
     * @return
     */
    List<String> getUserRoleNamesByUserId(Long userId);
}
